package com.zzyl.task;

import com.zzyl.entity.Reservation;
import com.zzyl.mapper.CustomerReservationMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;
import java.util.List;
import java.util.stream.Collectors;

@Component
@Slf4j
public class Task {

        @Autowired
        private CustomerReservationMapper customerReservationMapper ;
        //0/2 * * * * ?    0 0/10 8-18 * * ?

        @Scheduled(cron = "0 0/10 8-18 * * ?")
        public void modifyReservationStatusTask(){
                log.info("定时器开始执行------------");
                customerReservationMapper.updateStatus();
                log.info("定时器执行结束---------");
        }


}
